package com.example.cloud.consumer.core.controller;

import com.example.cloud.provider.api.model.User;
import com.example.cloud.provider.api.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhouzeng
 * @date 2018/7/30
 */
@RestController
@RequestMapping(value = "/user")
public class UserController {
    @Autowired(required = false)
    private UserService userService;

    @RequestMapping(value = "/findById", method = RequestMethod.GET)
    public User findByUserId(@RequestParam("id") Long id) {
        return userService.findById(id);
    }
}
